import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import Avue from "@smallwei/avue";
import "@smallwei/avue/lib/index.css";
import "./mock";
// import "default-passive-events";
import "element-plus/dist/index.css";
import directives from "./directives/index";
import globalDirectivRegist from "./directive";
// import VConsole from "vconsole";
// import obj from "./Message/message";
// 方式1
// if (process.env.NODE_ENV === "production") {
//   console.log("生产环境");
// } else {
//   new VConsole();
// }

import { createPinia } from "pinia"; //引入pinia

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app
  .use(router)
  .use(ElementPlus)
  .use(globalDirectivRegist)
  .use(createPinia())
  .use(Avue)
  // .use(obj)
  .use(directives)
  .mount("#app");
